<include file="Public:header" /><!-- header -->

<div class='wrap'>
<div id="icon-{$ur_here.action}" class="icon32"><br /></div><h2>{$ur_here.text}</h2>
<form action="{:U('Admin/Options/email')}" method="post" name="theForm">
<input type="hidden" name="action" value="email">
<table class="form-table">
<th scope="row">邮件服务</th>
<td>
	<label title='0'><input type='radio' name='mailService' value='0' <eq name="options.mailService" value="0" >checked='checked'</eq>/> <span>采用服务器内置的 Mail 服务</span></label>
	<label title='1'><input type='radio' name='mailService' value='1' <eq name="options.mailService" value="1" >checked='checked'</eq>/> <span>采用其他的 SMTP 服务</span></label><br /><span class="description">如果您选择了采用服务器内置的 Mail 服务，您不需要填写下面的内容。</span>
</td>
</tr>
  <tr valign="top">
    <th scope="row"><label for="h">SMTP 服务器地址</label></th>
    <td><input type='text' name='smtpHost' id='smtpHost' class='regular-text'  value='{$options.smtpHost}' /></td>
  </tr>
  <tr valign="top">
    <th scope="row"><label for="p">SMTP 服务器端口</label></th>
    <td><input type='text' name='smtpPort' id='smtpPort' class='small-text'  value='{$options.smtpPort}' /></td>
  </tr>
  <tr valign="top">
    <th scope="row"><label for="s">加密连接(SSL)</label></th>
    <td><select name='smtpSecure' id='smtpSecure'>
        <option value='' <eq name="options.smtpSecure" value="" >selected</eq>></option>
        <option value='ssl' <eq name="options.smtpSecure" value="ssl" >selected</eq>>ssl</option>
		<option value='tls' <eq name="options.smtpSecure" value="tls" >selected</eq>>tls</option>
      </select>
      <br />
      <span class="description">gmail需要启用ssl安全连接</span> </td>
  </tr>
  <tr valign="top">
    <th scope="row"><label for="s">SMTP 帐号</label></th>
    <td><input type='text' name='smtpUser' id='smtpUser' class='regular-text'  value='{$options.smtpUser}' />
    </td>
  </tr>
  <tr valign="top">
    <th scope="row"><label for="s">SMTP 密码</label></th>
    <td><input type='password' name='smtpPass' id='smtpPass' class='regular-text'  value='{$options.smtpPass}' />
    </td>
  </tr>
  <tr valign="top">
    <th scope="row"><label for="s">SMTP 编码</label></th>
    <td><label title='utf-8'><input type='radio' name='smtpCharset' value='utf-8' <eq name="options.smtpCharset" value="utf-8" >checked='checked'</eq>/> <span>国际化编码（utf8）</span></label>
	<label title='gb2312'><input type='radio' name='smtpCharset' value='gb2312' <eq name="options.smtpCharset" value="gb2312" >checked='checked'</eq>/> <span>简体中文</span></label>
	<label title='big5'><input type='radio' name='smtpCharset' value='big5' <eq name="options.smtpCharset" value="big5" >checked='checked'</eq>/> <span>繁体中文</span></label>
    </td>
  </tr>
  <tr valign="top">
    <th scope="row"><label for="f">发件人邮件地址</label></th>
    <td><input type='text' name='smtpFromTo' id='smtpFromTo' class='regular-text'  value='{$options.smtpFromTo}' /></td>
  </tr>
  <tr valign="top">
    <th scope="row"><label for="f">发件人姓名</label></th>
    <td><input type='text' name='smtpFromName' id='smtpFromName' class='regular-text'  value='{$options.smtpFromName}' /></td>
  </tr>
  <tr valign="top">
    <th scope="row"><label for="f">测试邮件地址</label></th>
    <td><input type="text" name="test" class='regular-text' value="{$users.email}" />
	<input type="button" class="button" value="发送测试邮件" onclick="send();"/>
    <br /><span class="description">尝试发送测试邮件之前，您必须保存设置</span><div id="result"></div></td>
  </tr>
</table>
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="保存更改" /></p>
</form>
</div>

<script type='text/javascript' src='__PUBLIC__/admin/js/Base.js?{$Think.const.VERHASH}'></script>
<script type='text/javascript' src='__PUBLIC__/admin/js/ThinkAjax.js?{$Think.const.VERHASH}'></script>
<script type="text/javascript">
ThinkAjax.image = ['__PUBLIC__/admin/images/wpspin_light.gif','',''];
function send() {
  var eles = document.forms['theForm'].elements;
  var test = eles['test'].value;
  ThinkAjax.send('{:U('Admin/Options/send')}','ajax=1&&test='+test,'','result');
}
</script>

<include file="Public:footer" />
